<template>
	<view>
		<view class="addBox">
			<view class="patList" v-for="(item, index) in patLists" :key="index">
				<u-swipe-action>
					<u-swipe-action-item :options="options">
						<view class="listPads">
							<view class="floatLeft">
								<u--image :src="require('@/static/my/mys.png')" width="80rpx" height="80rpx"></u--image>
							</view>
							<view class="floatLeft mgLeft">
								<view class="patTit">
									<text>{{item.name}}</text>
									<text class="textMgs">{{item.age}}岁</text>
									<view style="display: inline-block;">
										<u-icon v-if="item.sex == 0" bold name="man" color="#0782C9" size="16"></u-icon>
										<u-icon v-else bold name="woman" color="#DE6B60" size="16"></u-icon>
									</view>
									
								</view>
								<view class="patPone">{{item.phoneNumber}}</view>
							</view>
						</view>
					</u-swipe-action-item>
				</u-swipe-action>
			</view>
		</view>
		<view class="addfoot">
			<view class="addBtn" @click="addPatient()">添加就诊人</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				options: [{
					text: '编辑',
					style: {
						backgroundColor: '#0782C9',
						fontSize: '28rpx'
					}
				}, {
					text: '删除',
					style: {
						backgroundColor: '#DE6B60',
						fontSize: '28rpx'
					}
				}],
				patLists:[
					{
						name:'丰子恺',
						age:28,
						sex:0,
						phoneNumber:'18692735288'
					},
					{
						name:'丰子琪',
						age:26,
						sex:1,
						phoneNumber:'13203126653'
					}
				]
			}
		},
		methods: {
            addPatient(){
				uni.navigateTo({
					url:'/pages-my/patient/patientDetails'
				})
			}
		}
	}
</script>

<style lang="scss">
	body {
		background-color: $uni-bg-color-grey;
	}
    .addBox{
		padding: 20rpx;
	}
	.patList{
		border-radius: 10rpx;
		overflow: hidden;
		margin-bottom: 20rpx;
		box-shadow: 3rpx 3rpx 6rpx 0 #D3D0D0;
	}
	.listPads{
		padding: 40rpx;
	}
	.floatLeft{
		float: left;
	}
	.mgLeft{
		margin-left: 40rpx;
	}
	.patTit{
		font-size: 28rpx; 
		font-weight: bold;
	}
	.patPone{
		font-size: 26rpx;
		margin-top: 20rpx;
		color: #606266;
	}
	.textMgs{
		margin: 0 10rpx 0 30rpx;
	}
	.addfoot {
		position: fixed;
		bottom: 0;
		width: 100%;
		height: 140rpx;
		box-shadow: 0 -5rpx 10rpx #D3D0D0;
	}

	.addBtn {
		width: 90%;
		height: 80rpx;
		text-align: center;
		line-height: 80rpx;
		background: linear-gradient(to left, $uni-aicloud, $uni-aicloud-gradation);
		color: #ffffff;
		font-size: 28rpx;
		border-radius: 80rpx;
		margin: 30rpx auto;
	}
</style>